
package filters;

import java.awt.AlphaComposite;
import java.awt.Color;
import java.awt.Composite;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import java.awt.image.WritableRaster;


public class AlphaTest {

    BufferedImage imageTest = null;
    int width = 200;
    int height = 200;
    double prop = 0.67;
    int[] color1 = {200, 100, 10, 50};
    int[] color2 = {10, 200, 152, 50};
    
    public AlphaTest() {
        
        imageTest = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
        WritableRaster raster = imageTest.getRaster();
        Composite composite = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.1f);
        Graphics2D g2 = (Graphics2D)imageTest.getGraphics();
        g2.setComposite(composite);
        for (int i = 0;i<width;i++){
            for (int j = 0;j<height;j++){
                if (i<prop*width && j<prop*height){
                    raster.setPixel(i, j, color1);
                }
                if (i>(1-prop)*width && j>(1-prop)*height){
                    raster.setPixel(i, j, color2);
                }
            }
        }
        
    }

    public BufferedImage getImageTest() {
        return imageTest;
    }
    
}
